<?php
/**
 * Created by PhpStorm.
 * User: HUNG NGUYEN
 * Date: 1/16/14
 * Time: 11:24 AM
 */

require_once(__DIR__.'/controllers/BanController.php');
if(isset($_GET['func']))
{
    $function=$_GET['func'];
}
if(isset($_GET['soban1']))
{
    $soban1=$_GET['soban1'];
}
if(isset($_GET['soban2']))
{
    $soban2=$_GET['soban2'];
}

if($function=='doiban')
{
    if($soban1!=null && $soban2!=null)
    {
        return BanController::doiBan($soban1,$soban2);
    }
    else
    {
        echo json_encode(array('success'=>0,'errorcode'=>'invalid parameters'));
    }

}
elseif($function=='tachban')
{
    if($soban1!=null)
    {
        return BanController::tachBan($soban1);
    }
    else
    {
        echo json_encode(array('success'=>0,'errorcode'=>'invalid parameters'));
    }
}else
{
    echo json_encode(array('success'=>0,'errorcode'=>'invalid function'));
}